<form id="{$form.name}" name="{$form.name}">
<link rel="stylesheet" href="{$js_url}/jquery-ui/ui-openbiz/jquery.css" type="text/css" />
{literal}
<style>
.ui-tabs-panel .input_row{
width:100%;
padding-bottom:0px;
}
.ui-tabs-panel .odd{
background-color:#efefef;
width:100%;
}
.ui-tabs-panel table.input_row td.label_text{
padding-top:4px;
height:20px;
}
.ui-tabs-panel .input_row label {
padding-left:20px;
line-height:24px;
}
</style>
{/literal}
<div style="padding-left:35px; padding-right:30px;">
{include file="system_appbuilder_btn.tpl.html"}
	
	<div style="padding-left:0px;height:125px;" >
	<h2><span class="title_id" style="margin-right:10px;">{$form.currentRecordId}</span>{$form.title}</h2>
	<table><tr><td>
		{if $form.icon !='' }
		<div class="form_icon" style="padding:0px;width:90px;padding-top:5px;"><img  src="{$form.icon}" border="0" /></div>
		{/if}
	
		<div style="float:left; width:555px;padding-top:10px;">
			{if $dataPanel.fld_form_title.element}
			<h1 style="padding-bottom:10px;">
			{$dataPanel.fld_form_title.element}
			</h1>
			{/if} 
			{if $dataPanel.fld_form_description.element}
			<div class="input_row" style="line-height:20px;padding-bottom:5px;">		
			{$dataPanel.fld_form_description.element}
			</div>
			{else}
			<div style="height:15px;"></div>
			{/if}
		</div>
	</td></tr></table>
	</div>
	
	<div>
			{assign var=item value=$dataPanel.fld_location}	
			<table  class="input_row">				
			<tr>	
				<td >			
					<label style="text-align:left;">{$item.label}</label>			
				</td>
				<td>
					<span class="label_text" style="width:250px;">{$item.element}</span>
				</td>		
			</tr> 
			</table>				
			
			{assign var=item value=$dataPanel.fld_start_time}	
			<table  class="input_row">				
			<tr>	
				<td >			
					<label style="text-align:left;">{$item.label}</label>			
				</td>
				<td>
					<span class="label_text" style="width:230px;">{$item.element}</span>
				</td>		
						
			{assign var=item value=$dataPanel.fld_end_time}	
			
				<td >			
					<label style="text-align:left;">{$item.label}</label>			
				</td>
				<td>
					<span class="label_text" style="width:230px;">{$item.element}</span>
				</td>		
			</tr> 
			</table>
			
			
			{assign var=item value=$dataPanel.fld_recurrence}	
			<table  class="input_row">				
			<tr>	
				<td >			
					<label style="text-align:left;">{$item.label}</label>			
				</td>
				<td>
					<span class="label_text" style="width:230px;">{$item.element}</span>
				</td>		
						
			{assign var=item value=$dataPanel.fld_all_day}	
			
				<td >			
					<label style="text-align:left;">{$item.label}</label>			
				</td>
				<td>
					<span class="label_text" style="width:230px;">{$item.element}</span>
				</td>		
			</tr> 
			</table>
			
			{assign var=item value=$dataPanel.fld_description}	
			<table  class="input_row">				
			<tr>	
				<td >			
					<label style="text-align:left;">{$item.label}</label>			
				</td>
				<td>
					<span class="label_textarea" style="width:500px;">{$item.element}</span>
				</td>		
			</tr> 
			</table>
			
	</div>
	
	<div style="padding-left:8px;" id="tabs">
	<ul style="border-radius: none;">
	{assign var=es_counter value=0}
	{foreach item=setname name=elemsets  from=$form.elementSets}			
		{if $es_counter != 0 }
		<li><a href="#element_set_panel_{$es_counter}">{$setname}</a></li>
		{/if}
		{assign var=es_counter value=$es_counter+1}
	{/foreach}
	</ul>
	{assign var=es_counter value=0}
	{foreach item=setname name=elemsets  from=$form.elementSets}	
			
		{if $smarty.foreach.elemsets.first}		
			<div id="element_set_panel_{$es_counter}" >
		{else}
		
			<div id="element_set_panel_{$es_counter}" >
		{/if}	
		<div>
		{if $es_counter eq 0 }
 
		{else}		
			{assign var=es_elem_counter value=0}
			{assign var=col_counter value=0} 
			{foreach item=item key=itemName from=$dataPanel}
			{if $item.elementset eq $setname}
					{if $col_counter is odd}
					<table  class="input_row odd">
					{else}
					<table  class="input_row ">
					{/if}
								
					{if $item.type eq 'CKEditor' or $item.type eq 'RichText' 
						or $item.type eq 'Textarea' or $item.type eq 'LabelTextarea'
						or $item.type eq 'LabelTextarea' or $item.type eq 'LabelImage'
						 or $item.type eq 'RawData'
						 or $item.type eq 'IDCardReader'
						 or $item.type eq 'FormElement'
					}		
					{if $item.label}
					<tr>				
					<td style="width:160px;">	
						<label style="text-align:left;width:160px;">{$item.label}</label>
					</td>				
					<td>
						{if $errors.$itemName}
						<span class="input_error_msg" style="width:240px;">{$errors.$itemName}</span>
						{elseif $item.description}
						<span class="input_desc" style="width:240px;">{$item.description}</span>			
						{/if}
					</td>
					</tr>
					{/if}
					<tr><td colspan="2" align="center" >
						<span class="label_textarea" style="{if $item.width}width:{$item.width+15}px;{else}{if $default_label_textarea_width}{$default_label_textarea_width}{else}width:655px;{/if}{/if}">{$item.element}</span>
									
					</td>								
					{else}					
						<tr>
							<td >			
								<label style="text-align:left;">{$item.label}</label>			
							</td>
							<td>
								<span class="label_text" style="width:230px;">{$item.element}</span>
							</td>
					{/if}
						</tr> 
						</table>				
				
				{assign var=col_counter value=$col_counter+1}		
			
			{assign var=es_elem_counter value=$es_elem_counter+1}					
			{/if}
		{/foreach}
		{/if}	
			</div>
	 	
		
		</div>
		
		<script>
			//init_elementset('{$form.name}','{$es_counter}');			
		</script>
	{assign var=es_counter value=$es_counter+1}			
	{/foreach}
	
	
	<script>
	var formname = '{$form.name}';
	{literal}
	var c = new Cookies();		
	var $tabs = $j( "#tabs" ).tabs({
		select: function(event, ui)
		{				
			c.set(formname+'_lastTab',ui.panel.id);			
		}
	}).css({'padding-left':'0px','width':'670px'});		
	lastViewedTab = c.get(formname+'_lastTab');
	$tabs.tabs('select','#'+lastViewedTab);
	{/literal}
	</script>
	
	

	</div>
	
		<div style="height:10px;"></div>
	 	{if $actionPanel|@count > 0}
		<p class="input_row">
			
			{foreach item=elem from=$actionPanel}
				{$elem.element}
			{/foreach}
		</p>
		{/if}

	{if $errors}
	    <div id='errorsDiv' class='innerError errorBox'>
	    {foreach item=errMsg from=$errors}
	        <div>{$errMsg}</div>
	    {/foreach}
	    {literal}<script>setTimeout("$('errorsDiv').fade( {from: 1, to: 0});",3000);</script>{/literal}
	    </div>
	{/if}
	
	{if $notices}
	    <div id='noticeDiv' class='noticeBox' >
	    {foreach item=noticeMsg from=$notices}
	        <div>{$noticeMsg}</div>
	    {/foreach}
	    </div>
	    {literal}<script>setTimeout("$('noticeDiv').fade( {from: 1, to: 0});",3000);</script>{/literal}
	{/if}
	
		<div style="height:15px;">
		<div id='{$form.name}.load_disp' style="display:none;">
		<img  src="{$image_url}/form_ajax_loader.gif"/>
		</div>
		</div>
	
</div>
</form>